import Upload from "@/utils/upload";
import { Menu } from "antd";

interface UploadFilesProps {}

const UploadFiles = (props: any) => {
  const { uploadPath } = props;
  const target = {
    uploadPath,
    isFolder: false,
  };

  return (
    <Menu>
      <Menu.Item key="1">
        <div
          style={{ cursor: "pointer" }}
          onClick={() => {
            const isFolder = false;
            const t = new Date().getTime();
            Upload.chooseFile(
              {
                ...target,
                t,
              },
              isFolder
            );
          }}
        >
          上传文件
        </div>
      </Menu.Item>
      <Menu.Item key="1">
        <div
          style={{ cursor: "pointer" }}
          onClick={() => {
            const isFolder = true;
            const t = new Date().getTime();
            Upload.chooseFile(
              {
                ...target,
                t,
              },
              isFolder
            );
          }}
        >
          上传文件夹
        </div>
      </Menu.Item>
    </Menu>
  );
};

export default UploadFiles;
